package com.rfsp.common.pojo.vo;

import java.util.List;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.rfsp.common.util.JsonUtil;

@JsonInclude(value = JsonInclude.Include.NON_NULL) 
public class AreaVO {
	
	private String text;
	private String id;
	private String parent;
	private String value;
	private List<AreaVO> children;

	public AreaVO() {
		
	}
	
	public AreaVO(String id, String text) {
		this.id = id;
		this.text = text;
	}
    public AreaVO(String id, String text, String parent) {
        this.id = id;
        this.text = text;
        this.parent = parent;
    }
    
    public AreaVO(String id, String text, String parent, String value) {
        this.id = id;
        this.text = text;
        this.parent = parent;
        this.value = value;
    }
	
	public String getText() {
		return text;
	}
	
	public void setText(String text) {
		this.text = text;
	}

	public String getParent() {
		return parent;
	}

	public void setParent(String parent) {
		this.parent = parent;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}
	
	

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public List<AreaVO> getChildren() {
		return children;
	}
	
	public void setChildren(List<AreaVO> children) {
		this.children = children;
	}

    public String toString(){
        try {
            return JsonUtil.toJson(this);
        } catch (JsonProcessingException e) {
            return text+value;
        }
    }
}